#include "queue.h"
#include <stdio.h>

void Print(student* data)
{
    if(data == NULL) return;
    printf("<-Student-> Number: %lld, Sex: %s, Name: %s\n", data->ID, data->sex, data->name);
}

int main()
{
    student stu[3] = 
    {
        {.ID = 16205140106, .sex = "M", .name = "Sun-xiaoyu"},
        {.ID = 16205140434, .sex = "F", .name = "Ding-yangmin"},
        {.ID = 16205140132, .sex = "M", .name = "Bu-yuanhao"},
    };
    printf("\n-------------------------------------- Program Output ----------------------------------------\n\n");

    Queue que = QueueCreate();
    QueuePushBack(&que, stu[1]);
    QueuePushBack(&que, stu[2]);
    QueuePushBack(&que, stu[0]);
    
    student tmp;
    QueuePeekFront(&que,&tmp);
    QueuePopFront(&que);
    Print(&tmp);

    QueuePeekBack(&que,&tmp);
    QueuePopBack(&que);
    Print(&tmp);

    QueuePeekFront(&que,&tmp);
    QueuePopFront(&que);
    Print(&tmp);

    printf("\n--------------------------------------- Program End -----------------------------------------\n");

    return 0;
}
